Micron Document
--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
| SparkN0de-git | SparkN0de |
--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------


Commit c039ff2e2a363c820739c3e7068baf65b702c0a6


Parents : ab388cf
Author : Mark Qvist <mark@unsigned.io>
Date : 2021-05-04T11:07:46+02:00

Conversation class skeleton

Changes

1 files changed, 17 insertions(+), 0 deletions(-)


Diff

diff --git a/nomadnet/Conversation.py b/nomadnet/Conversation.py
new file mode 100644
index 0000000..ee49da0
--- /dev/null
+++ b/nomadnet/Conversation.py
@@ -0,0 +1,17 @@
+import os
+import RNS
+import LXMF
+
+class Conversation:
+ @staticmethod
+ def ingest(lxmessage, app):
+ source_hash_path = RNS.hexrep(lxmessage.source_hash, delimit=False)
+ conversation_path = app.conversationpath + "/" + source_hash_path
+
+ if not os.path.isdir(conversation_path):
+ os.makedirs(conversation_path)
+
+ lxmessage.write_to_directory(conversation_path)
+
+ def __init__(self):
+ pass
\ No newline at end of file


──────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────